package com.fdsc.erp.controller;

import com.fdsc.erp.service.FinancialService;
import com.fdsc.erp.util.PageUtils;
import com.fdsc.erp.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("financial")
public class FinancialController {
    @Autowired
    FinancialService financialService;
    @RequestMapping("selectFinancial")
    public R selectFinancial(@RequestParam Map<String, Object> params) {
        try {
//            System.out.println(financialEntity.toString());
            PageUtils page =  financialService.queryPage(params);
            return R.ok().put("page", page);
        } catch (Exception e) {
            e.printStackTrace();
            return R.error();
        }

    }

}
